package entity

import "ruoyi-go/utils"

// Model edge_sensor  传感器管理表
type EdgeSensor struct {
	Id                  int64          `json:"id" gorm:"primaryKey;column:id" form:"id"`                                    //自增ID
	SensorCode          string         `json:"sensorCode" gorm:"sensor_code" form:"sensorCode"`                             //传感器编码
	SensorName          string         `json:"sensorName" gorm:"sensor_name" form:"sensorName"`                             //传感器名称
	SensorTypeId        string         `json:"sensorTypeId" gorm:"sensor_type_id" form:"sensorTypeId"`                      //传感器类型ID
	SensorType          string         `json:"sensorType" gorm:"sensor_type" form:"sensorType"`                             //传感器类型
	SensorTypeName      string         `json:"sensorTypeName" gorm:"sensor_type_name" form:"sensorTypeName"`                //传感器类型名称
	SensorModel         string         `json:"sensorModel" gorm:"sensor_model" form:"sensorModel"`                          //传感器型号
	SensorLocation      string         `json:"sensorLocation" gorm:"sensor_location" form:"sensorLocation"`                 //传感器安装位置
	InstallTime         utils.JsonTime `json:"installTime" gorm:"install_time" form:"installTime"`                          //安装时间
	CalibrationTime     utils.JsonTime `json:"calibrationTime" gorm:"calibration_time" form:"calibrationTime"`              //校准时间
	Status              string         `json:"status" gorm:"status" form:"status"`                                          //状态：online-在线，offline-离线，error-故障
	InternalCodeValue   int64          `json:"internalCodeValue" gorm:"internal_code_value" form:"internalCodeValue"`       //内码值
	Unit                string         `json:"unit" gorm:"unit" form:"unit"`                                                //单位
	MinValue            int64          `json:"minValue" gorm:"min_value" form:"minValue"`                                   //最小值
	MaxValue            int64          `json:"maxValue" gorm:"max_value" form:"maxValue"`                                   //最大值
	ThresholdLow        int64          `json:"thresholdLow" gorm:"threshold_low" form:"thresholdLow"`                       //低阈值
	ThresholdHigh       int64          `json:"thresholdHigh" gorm:"threshold_high" form:"thresholdHigh"`                    //高阈值
	CurrentValue        int64          `json:"currentValue" gorm:"current_value" form:"currentValue"`                       //当前值
	MaintenanceCycle    int64          `json:"maintenanceCycle" gorm:"maintenance_cycle" form:"maintenanceCycle"`           //维护周期(天)
	NextMaintenanceTime utils.JsonTime `json:"nextMaintenanceTime" gorm:"next_maintenance_time" form:"nextMaintenanceTime"` //下次维护时间
	Description         string         `json:"description" gorm:"description" form:"description"`                           //描述
	IsEnabled           int64          `json:"isEnabled" gorm:"is_enabled" form:"isEnabled"`                                //是否启用：0-禁用，1-启用
	CreateTime          utils.JsonTime `json:"createTime" gorm:"create_time" form:"createTime"`                             //创建时间
	UpdateTime          utils.JsonTime `json:"updateTime" gorm:"update_time" form:"updateTime"`                             //更新时间
	SensorField1        string         `json:"sensorField1" gorm:"sensor_field1" form:"sensorField1"`                       //备用字段1
	SensorField2        string         `json:"sensorField2" gorm:"sensor_field2" form:"sensorField2"`                       //备用字段2
	SensorField3        string         `json:"sensorField3" gorm:"sensor_field3" form:"sensorField3"`                       //备用字段3
	SensorField4        string         `json:"sensorField4" gorm:"sensor_field4" form:"sensorField4"`                       //备用字段4
	SensorField5        string         `json:"sensorField5" gorm:"sensor_field5" form:"sensorField5"`                       //备用字段5
}

func (EdgeSensor) TableName() string {
	return "edge_sensor"
}

type EdgeSensorPageReq struct {
	Pager
	TimeParams
	Id                  int64          `json:"id" gorm:"primaryKey;column:id" form:"id"`                                    //自增ID
	SensorCode          string         `json:"sensorCode" gorm:"sensor_code" form:"sensorCode"`                             //传感器编码
	SensorName          string         `json:"sensorName" gorm:"sensor_name" form:"sensorName"`                             //传感器名称
	SensorTypeId        string         `json:"sensorTypeId" gorm:"sensor_type_id" form:"sensorTypeId"`                      //传感器类型ID
	SensorType          string         `json:"sensorType" gorm:"sensor_type" form:"sensorType"`                             //传感器类型
	SensorTypeName      string         `json:"sensorTypeName" gorm:"sensor_type_name" form:"sensorTypeName"`                //传感器类型名称
	SensorModel         string         `json:"sensorModel" gorm:"sensor_model" form:"sensorModel"`                          //传感器型号
	SensorLocation      string         `json:"sensorLocation" gorm:"sensor_location" form:"sensorLocation"`                 //传感器安装位置
	InstallTime         utils.JsonTime `json:"installTime" gorm:"install_time" form:"installTime"`                          //安装时间
	CalibrationTime     utils.JsonTime `json:"calibrationTime" gorm:"calibration_time" form:"calibrationTime"`              //校准时间
	Status              string         `json:"status" gorm:"status" form:"status"`                                          //状态：online-在线，offline-离线，error-故障
	InternalCodeValue   int64          `json:"internalCodeValue" gorm:"internal_code_value" form:"internalCodeValue"`       //内码值
	Unit                string         `json:"unit" gorm:"unit" form:"unit"`                                                //单位
	MinValue            int64          `json:"minValue" gorm:"min_value" form:"minValue"`                                   //最小值
	MaxValue            int64          `json:"maxValue" gorm:"max_value" form:"maxValue"`                                   //最大值
	ThresholdLow        int64          `json:"thresholdLow" gorm:"threshold_low" form:"thresholdLow"`                       //低阈值
	ThresholdHigh       int64          `json:"thresholdHigh" gorm:"threshold_high" form:"thresholdHigh"`                    //高阈值
	CurrentValue        int64          `json:"currentValue" gorm:"current_value" form:"currentValue"`                       //当前值
	MaintenanceCycle    int64          `json:"maintenanceCycle" gorm:"maintenance_cycle" form:"maintenanceCycle"`           //维护周期(天)
	NextMaintenanceTime utils.JsonTime `json:"nextMaintenanceTime" gorm:"next_maintenance_time" form:"nextMaintenanceTime"` //下次维护时间
	Description         string         `json:"description" gorm:"description" form:"description"`                           //描述
	IsEnabled           int64          `json:"isEnabled" gorm:"is_enabled" form:"isEnabled"`                                //是否启用：0-禁用，1-启用
	CreateTime          utils.JsonTime `json:"createTime" gorm:"create_time" form:"createTime"`                             //创建时间
	UpdateTime          utils.JsonTime `json:"updateTime" gorm:"update_time" form:"updateTime"`                             //更新时间
	SensorField1        string         `json:"sensorField1" gorm:"sensor_field1" form:"sensorField1"`                       //备用字段1
	SensorField2        string         `json:"sensorField2" gorm:"sensor_field2" form:"sensorField2"`                       //备用字段2
	SensorField3        string         `json:"sensorField3" gorm:"sensor_field3" form:"sensorField3"`                       //备用字段3
	SensorField4        string         `json:"sensorField4" gorm:"sensor_field4" form:"sensorField4"`                       //备用字段4
	SensorField5        string         `json:"sensorField5" gorm:"sensor_field5" form:"sensorField5"`                       //备用字段5
}
